// 签名
import _bale from '../utils/package.js'
// 获取不同的接口地址
import { SSO_API, SHARE_API, ACTIVITY_API ,INDEXS_API} from '../config/index.js'
import { Service } from '../utils/server.js'
class GoodsModel extends Service {
  // 商品详情
  getGoodsDetail(params) {
    return this.postRequest(INDEXS_API + '/seckill/selectGoodsDetail_2', {
      data: _bale('selectGoodsDetail_2', params)
    })
  }
  // 商品尺码
  getGoodSpec(params) {
    return this.postRequest(ACTIVITY_API + '/goods/selectSpecName', {
      data: _bale('selectSpecName', params)
    })
  }
  // 加入购物车
  addShopCart(params) {
    return this.postRequest(ACTIVITY_API + '/shopCart/addShopCart', {
      data: _bale('addShopCart', params)
    })
  }

  // 立即购买
  buyNow(params) {
    return this.postRequest(ACTIVITY_API + '/shopCart/buyNow', {
      data: _bale('buyNow', params)
    })
  }
  // 商品详情 畅销商品
  getHotGoods(params) {
    return this.postRequest(SHARE_API + '/applietLazy/selectGoodsBySales', {
      data: _bale('selectGoodsBySales', params)
    })
  }
}

export { GoodsModel }
